/** @noSelfInFile **/
import {LocModel} from "../../../base/LocModel";
import {PlayerSourceData} from "../../../../dataSource/DataSource";
import {UnitModel} from "../../../adapterModel/model3/UnitModel";


export let playerAdapter: { adapter: IPlayerAdapter } = { adapter: undefined };

export interface IPlayerAdapter {
    createHandle(handle: any): any
    isLocalPlayer(handle: any): boolean;
    getLocalPlayerId(): number;
    displayText(handle: any, text: string): void
    getPlayerId(handle: any): number
    clearSelected(handle: any): void
    getName(handle: any): string
    setName(handle: any, value: string): void
    getStartLoc(handle: any):LocModel
    getTeam(handle: any): number
    coordsFogged(handle: any, loc: LocModel): boolean
    coordsMasked(handle: any, loc: LocModel): boolean
    coordsVisible(handle: any, loc: LocModel): boolean
    removeAllGuardPositions(handle: any): void
    toWin(handle: any): void;
    toLose(handle: any): void;
    getGold(handle: any): number
    setGold(handle: any, value: number): void;
    getLumber(handle: any): number
    setLumber(handle: any, value: number): void;
    getAllFood(handle: any): number
    setAllFood(handle: any, value: number): void
    getUsedFood(handle: any): number
    setUsedFood(handle: any, value: number): void;
    isPlaying(handle: any): boolean
    isPlayerAlly(handle: any, player: any): boolean
    setAlly(handle: any, player: any, bool: boolean):void
    removeFog(handle: any, rect: any): any;
    addFog(handle: any, fog: any): any;
    signal(handle: any, loc: LocModel): void
    setTech(handle: any, id: string, lv: number): void
    getTech(handle: any, id: string): number
    toBeUnitOwner(handle: any, unitModel: UnitModel, changeColor: boolean): void
    setPlayerGoldReward(handle: any, bool: boolean): void;
    moveUnit(unit: UnitModel, loc: LocModel): void
    moveCamera(handle: any, loc: LocModel, height: number, duration: number): void;
    setCameraHeight(handle: any, height: number): void;
    setCameraAngle(handle: any, angle: number): void;
    // getCameraAngle(handle: any): void;
    getCameraY(handle: any): number;
    getCameraX(handle: any): number;
    getFakeRandom(handle: any, min: number, max: number, data: PlayerSourceData): number;
    getStoredString(handle: any, key: string): string
    setStoredString(handle: any, key: string, value: string) : void;

    setRoomList(handle: any, key: string, value: string): void;
    // 商城相关
    getHasMallItem(handle: any, key: string): boolean;
    getMallItemCount(handle: any, key: string): number;
    consumMallItemCount(handle: any, key: string, num: number): boolean;
    getMapLevel(handle: any): number;
    destroy(handle: any): void
    bindHandle(handle: any): void;
    equal(handle1: any, handle2: any): boolean
    isValid(handle: any): boolean;
    startCheckSync(): void;
}
